package com.py.pythink.controller;

import com.py.pythink.bo.SmsCodeBo;
import com.py.pythink.service.intf.SmslogService;
import com.py.pythink.vo.R;
import io.swagger.annotations.Api;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/api/smslog/")
@CrossOrigin
@Api(value = "",tags = "短信验证码的一系列操作")
public class SmslogController {
    @Autowired
    private SmslogService smslogService;
    @PostMapping("sendcode.do")
    public R sendCode(String phone){
        return smslogService.sendCode(phone);
    }
    @PostMapping("sendcodelogin.do")
    public R sendCodeLogin(String phone){
        return smslogService.sendCodeLogin(phone);
    }
    @PostMapping("checkcode.do")
    public R checkCode(SmsCodeBo smsCodeBo){
        return smslogService.checkCode(smsCodeBo);
    }

    @GetMapping("all.do")
    public R selectAll(){
        return smslogService.selectAll();
    }
}
